package pe.edu.upc.dew.grupo04.service;

import java.util.List;
import org.springframework.dao.EmptyResultDataAccessException;
import pe.edu.upc.dew.grupo04.dao.TicketDao;
import pe.edu.upc.dew.grupo04.model.Ticket;

public class TicketServiceImpl implements TicketService {

	private TicketDao ticketDao;
	private Ticket ticket;

	public void setTicketDao(TicketDao ticketDao) {
		this.ticketDao = ticketDao;
	}

	@Override
	public void crearTicket(Ticket ticket) {
		ticketDao.crearTicket(ticket);

	}

	@Override
	public Ticket getTicketPorCodigo(int codTicket) {
		return ticketDao.getTicketPorCodigo(codTicket);
	}

	@Override
	public List<Ticket> getTickets() {
		return ticketDao.getTickets();
	}

	@Override
	public void eliminarTicket(int codTicket) {
		ticketDao.eliminarTicket(codTicket);

	}

	public int getCountTicketPorFuncion(int codFuncion){
		return ticketDao.getCountTicketPorFuncion(codFuncion);
	}

}
